package main

import (
	"fmt"
)

func setData(location int, data int) {
	defer func() {
		if err := recover(); err != nil {
			fmt.Println(err)
		}
	}()
	var arr [10]int
	arr[location] = data
}

func main() {
	// 使用 panic 制造异常
	// panic("crash")

	setData(20, 88)

	fmt.Println("Everything is ok")
}
